package com.hnkywl.sts.entity.cwgl.yjyys;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.organ.Gsjg;
import com.hnkywl.sts.entity.sys.Yg;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 月经营预算
 * User: ccr
 * Date: 13-6-16
 * Time: 下午2:31
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "T_BIZ_YJYYS")
@Where(clause = "deleted!='1'")
public class Yjyys extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqYjyys", allocationSize = 1, sequenceName = "SEQ_BIZ_YJYYS")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqYjyys")
    private Long id;
    /**
     * 公司
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GS_ID")
    private Gsjg gs;
    /**
     * 部门
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "BM_ID")
    private Gsjg bm;
    /**
     * 年份
     */
    private Integer nf;
    /**
     * 月份
     */
    private Integer yf;

    /**
     * 状态 "ybc","ytj"
     */
    private String zt;
    /**
     * 审核状态
     */
    private String shzt;
    /**
     * 审核日期
     */
    private Date shrq;
    /**
     * 审核人
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SHR_ID")
    private Yg shr;

    /**
     * 所有项目
     */
    @OneToMany(fetch = FetchType.LAZY)
    @Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
    @JoinColumn(name = "YJYYS_ID")
    private List<Yjyysmx> xms;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Gsjg getGs() {
        return gs;
    }

    public void setGs(Gsjg gs) {
        this.gs = gs;
    }

    public Gsjg getBm() {
        return bm;
    }

    public void setBm(Gsjg bm) {
        this.bm = bm;
    }

    public Integer getNf() {
        return nf;
    }

    public void setNf(Integer nf) {
        this.nf = nf;
    }

    public Integer getYf() {
        return yf;
    }

    public void setYf(Integer yf) {
        this.yf = yf;
    }

    public String getZt() {
        return zt;
    }

    public void setZt(String zt) {
        this.zt = zt;
    }

    public String getShzt() {
        return shzt;
    }

    public void setShzt(String shzt) {
        this.shzt = shzt;
    }

    public Date getShrq() {
        return shrq;
    }

    public void setShrq(Date shrq) {
        this.shrq = shrq;
    }

    public Yg getShr() {
        return shr;
    }

    public void setShr(Yg shr) {
        this.shr = shr;
    }

    public List<Yjyysmx> getXms() {
        return xms;
    }

    public void setXms(List<Yjyysmx> xms) {
        this.xms = xms;
    }
}
